import request from '@/utils/newRequest'

// 获取网站信息
export function getWebsite(params) {
  return request({
    url: '/website',
    method: 'get',
    params
  })
}
// 修改网站配置
export function editWebsite(data) {
  return request({
    url: '/website',
    method: 'put',
    data
  })
}

// 友情链接列表
export function getLinksLists(params) {
  return request({
    url: '/links',
    method: 'get',
    params
  })
}
// 新增友情链接
export function addNewLinks(data) {
  return request({
    url: '/links',
    method: 'post',
    data
  })
}
// 删除友情链接
export function deleteLinks(id) {
  return request({
    url: '/links/' + id,
    method: 'delete'
  })
}
// 编辑友情链接
export function modifyLinks(id, data) {
  return request({
    url: '/links/' + id,
    method: 'put',
    data
  })
}

// 轮播列表
export function getCarouselsLists(params) {
  return request({
    url: '/carousels',
    method: 'get',
    params
  })
}
// 删除轮播
export function deleteCarousels(id) {
  return request({
    url: '/carousels/' + id,
    method: 'delete'
  })
}
// 新增友情链接
export function addNewCarousels(data) {
  return request({
    url: '/carousels',
    method: 'post',
    data
  })
}
// 修改轮播
export function modifyCarousels(id, data) {
  return request({
    url: '/carousels/' + id,
    method: 'put',
    data
  })
}

// 获取栏目树
export function getColumnTrees(params) {
  return request({
    url: '/column-trees',
    method: 'get',
    params
  })
}
// 栏目列表
export function getColumnsLists(params) {
  return request({
    url: '/columns',
    method: 'get',
    params
  })
}
// 获取栏目详情
export function getColumnDetail(id) {
  return request({
    url: '/columns/' + id,
    method: 'get'
  })
}
// 删除栏目
export function deleteColumns(id) {
  return request({
    url: '/columns/' + id,
    method: 'delete'
  })
}
// 新增友情链接
export function addNewColumn(data) {
  return request({
    url: '/columns',
    method: 'post',
    data
  })
}
// 修改轮播
export function modifyColumn(id, data) {
  return request({
    url: '/columns/' + id,
    method: 'put',
    data
  })
}

// 获取文章列表
export function getArticlesLists(params) {
  return request({
    url: '/articles',
    method: 'get',
    params
  })
}
// 获取文章详情
export function getAricleDetail(id) {
  return request({
    url: '/articles/' + id,
    method: 'get'
  })
}
// 删除文章
export function deleteArticle(id) {
  return request({
    url: '/articles/' + id,
    method: 'delete'
  })
}
// 添加文章
export function addNewArticle(data) {
  return request({
    url: '/articles',
    method: 'post',
    data
  })
}
// 更新文章
export function modifyArticle(id, data) {
  return request({
    url: '/articles/' + id,
    method: 'put',
    data
  })
}
